import xlrd
f=xlrd.open_workbook(r'practise.xlsx')
sheet = f.sheet_by_index(0)
nrows = sheet.nrows
list = []
for i in range(17):
    s=set()
    list.append(s)
for i in range(nrows):
    if i == 0:
        continue
    cell_value = sheet.cell(i, 2).value
    x = 0;
    for j in cell_value:
        if j >= '0' and j <= '9':
            x=x*10+int(j)
        else:
            if x != 0:
                list[x].add(i)
            x = 0
    if x != 0:
        list[x].add(i)

idx = 0
for i in list:
    print(idx,end=" ")
    print(i)
    idx+=1